package com.example.hxds.common.api;

import com.example.hxds.common.dto.RegisterNewDriverDTO;
//import com.example.hxds.common.errorDecoder.DriverApiErrorDecoder;
import com.example.hxds.common.fallback.DriverApiFallbackFactory;
import com.example.hxds.common.util.R;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(name = "hxds-dr",path = "/driver", fallbackFactory = DriverApiFallbackFactory.class/*, configuration = DriverApiErrorDecoder.class*/)
// TODO 后续尝试完善对应的 feign接口调用日志及服务调用失败的回退逻辑（服务降级）
public interface DriverApi {

    @PostMapping("/registerNewDriver")
    @Operation(summary = "司机注册")
    R registerNewDriver(@RequestBody RegisterNewDriverDTO registerNewDriverDTO);

}
